<?php

namespace App\Models\Entity;

use Swoft\Db\Model;
use Swoft\Db\Bean\Annotation\Column;
use Swoft\Db\Bean\Annotation\Entity;
use Swoft\Db\Bean\Annotation\Id;
use Swoft\Db\Bean\Annotation\Required;
use Swoft\Db\Bean\Annotation\Table;

/**
 * 接口用户信息表

 * @Entity()
 * @Table(name="m_userapi")
 * @uses      MUserapi
 * @version   2018年07月04日
 */
class MUserapi extends Model
{
    /**
     * @var int $userid 用户编号
     * @Id()
     * @Column(name="userid", type="integer")
     */
    private $userid;

    /**
     * @var int $btype
     * @Column(name="btype", type="tinyint", default="1")
     */
    private $btype;

    /**
     * @var string $ipwhite IP白名单 多个用,分割
     * @Column(name="ipwhite", type="string", length=512)
     */
    private $ipwhite;

    /**
     * @var string $backurl 回调地址
     * @Column(name="backurl", type="string", length=255)
     */
    private $backurl;

    /**
     * @var string $userkey 用户密钥
     * @Column(name="userkey", type="string", length=32)
     * @Required()
     */
    private $userkey;

    /**
     * @var float $balance 用户余额
     * @Column(name="balance", type="decimal", default="0.0000")
     */
    private $balance;

    /**
     * @var int $backopen 是否打开回调 0.不打开 1.打开
     * @Column(name="backopen", type="tinyint", default="1")
     */
    private $backopen;

    /**
     * @var string $remark 手操备注
     * @Column(name="remark", type="string", length=200)
     */
    private $remark;

    /**
     * @var int $credit 授信额度，0为不授信
     * @Column(name="credit", type="integer", default="0")
     */
    private $credit;

    /**
     * @var int $oprice 账号渠道属性，0四渠道，1两渠道
     * @Column(name="oprice", type="tinyint", default="0")
     */
    private $oprice;

    /**
     * @var int $assacc 关联帐户，用于关联帐户间的资金划转
     * @Column(name="assacc", type="integer", default="0")
     */
    private $assacc;

    /**
     * @var int $frozen 帐户状态 0：正常 1：禁止提单
     * @Column(name="frozen", type="tinyint", default="0")
     */
    private $frozen;

    /**
     * @var int $bill 0.不带票 1.带票
     * @Column(name="bill", type="tinyint", default="1")
     */
    private $bill;

    /**
     * 用户编号
     * @param int $value
     * @return $this
     */
    public function setUserid(int $value)
    {
        $this->userid = $value;

        return $this;
    }

    /**
     * @param int $value
     * @return $this
     */
    public function setBtype(int $value): self
    {
        $this->btype = $value;

        return $this;
    }

    /**
     * IP白名单 多个用,分割
     * @param string $value
     * @return $this
     */
    public function setIpwhite(string $value): self
    {
        $this->ipwhite = $value;

        return $this;
    }

    /**
     * 回调地址
     * @param string $value
     * @return $this
     */
    public function setBackurl(string $value): self
    {
        $this->backurl = $value;

        return $this;
    }

    /**
     * 用户密钥
     * @param string $value
     * @return $this
     */
    public function setUserkey(string $value): self
    {
        $this->userkey = $value;

        return $this;
    }

    /**
     * 用户余额
     * @param float $value
     * @return $this
     */
    public function setBalance(float $value): self
    {
        $this->balance = $value;

        return $this;
    }

    /**
     * 是否打开回调 0.不打开 1.打开
     * @param int $value
     * @return $this
     */
    public function setBackopen(int $value): self
    {
        $this->backopen = $value;

        return $this;
    }

    /**
     * 手操备注
     * @param string $value
     * @return $this
     */
    public function setRemark(string $value): self
    {
        $this->remark = $value;

        return $this;
    }

    /**
     * 授信额度，0为不授信
     * @param int $value
     * @return $this
     */
    public function setCredit(int $value): self
    {
        $this->credit = $value;

        return $this;
    }

    /**
     * 账号渠道属性，0四渠道，1两渠道
     * @param int $value
     * @return $this
     */
    public function setOprice(int $value): self
    {
        $this->oprice = $value;

        return $this;
    }

    /**
     * 关联帐户，用于关联帐户间的资金划转
     * @param int $value
     * @return $this
     */
    public function setAssacc(int $value): self
    {
        $this->assacc = $value;

        return $this;
    }

    /**
     * 帐户状态 0：正常 1：禁止提单
     * @param int $value
     * @return $this
     */
    public function setFrozen(int $value): self
    {
        $this->frozen = $value;

        return $this;
    }

    /**
     * 0.不带票 1.带票
     * @param int $value
     * @return $this
     */
    public function setBill(int $value): self
    {
        $this->bill = $value;

        return $this;
    }

    /**
     * 用户编号
     * @return mixed
     */
    public function getUserid()
    {
        return $this->userid;
    }

    /**
     * @return int
     */
    public function getBtype()
    {
        return $this->btype;
    }

    /**
     * IP白名单 多个用,分割
     * @return mixed
     */
    public function getIpwhite()
    {
        return $this->ipwhite;
    }

    /**
     * 回调地址
     * @return mixed
     */
    public function getBackurl()
    {
        return $this->backurl;
    }

    /**
     * 用户密钥
     * @return mixed
     */
    public function getUserkey()
    {
        return $this->userkey;
    }

    /**
     * 用户余额
     * @return float
     */
    public function getBalance()
    {
        return $this->balance;
    }

    /**
     * 是否打开回调 0.不打开 1.打开
     * @return int
     */
    public function getBackopen()
    {
        return $this->backopen;
    }

    /**
     * 手操备注
     * @return mixed
     */
    public function getRemark()
    {
        return $this->remark;
    }

    /**
     * 授信额度，0为不授信
     * @return mixed
     */
    public function getCredit()
    {
        return $this->credit;
    }

    /**
     * 账号渠道属性，0四渠道，1两渠道
     * @return mixed
     */
    public function getOprice()
    {
        return $this->oprice;
    }

    /**
     * 关联帐户，用于关联帐户间的资金划转
     * @return mixed
     */
    public function getAssacc()
    {
        return $this->assacc;
    }

    /**
     * 帐户状态 0：正常 1：禁止提单
     * @return mixed
     */
    public function getFrozen()
    {
        return $this->frozen;
    }

    /**
     * 0.不带票 1.带票
     * @return int
     */
    public function getBill()
    {
        return $this->bill;
    }

}
